package com.example.patient.jpa;

import com.example.common.entity.SysDiseaseEncyclopedia;
import io.swagger.models.auth.In;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @ClassName SysDiseaseEncyclopediaJpa
 * @Author wengjt
 * @Date 2021/4/2016:03
 * @Description
 **/
public interface SysDiseaseEncyclopediaJpa extends JpaRepository<SysDiseaseEncyclopedia, Integer> {
    @Query(value = "select  *" +
            " from sys_disease_encyclopedia where dec_id_bigint=:decId and disable_bit=0 limit :skip ,:limit", nativeQuery = true)
    List<SysDiseaseEncyclopedia> findByDecIdPage(@Param("decId") Integer decId, @Param("skip") Integer skip, @Param("limit") Integer limit);
    @Query(value = "select  count(*)" +
            " from sys_disease_encyclopedia where dec_id_bigint=:decId and disable_bit=0 ", nativeQuery = true)
    Integer countByDecId(@Param("decId")Integer decId);

    SysDiseaseEncyclopedia findByDeId(Integer deId);

    //@Query(value="select * from sys_disease_encyclopedia where name_nvarchar like ")

}
